<template>
  <div>
    <Header></Header>
    <div class="mymessage">
      <el-container style="height: 100vh; border: 1px solid #eee">
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
          <el-menu>
            <el-menu-item index="1">私信</el-menu-item>
          </el-menu>
        </el-aside>

        <el-main>
          <ul class="ul_mess">
            私信
          </ul>
          <div class="comment">
            <p class="blank"></p>
            <div class="commentLogo" v-for="(item, index) in list" :key="index">
              <div class="top">
              <div class="logo">
                <img class="img_logo" src="./images/headport.jpg" />
              </div>
              <div class="cont">
                <div class="sec1">
                  <div class="mm">
                    <span class="name">{{ item.send.name }} </span>
                    <span class="time" 
                      >
                      <time>{{ item.sendTime }}</time>
                      <i class="el-icon-time"></i>
                      </span
                    >
                  </div>
                </div>
                <div class="sec2">
                  <p class="text">{{ item.content }}</p>
                </div>
              </div>
              </div>
            </div>
          </div>
        </el-main>
      </el-container>
    </div>
  </div>
</template>

<script>
import { req, API_AUTH_PRIVATE_MESSAGE } from '@/api/api'
export default {
  name: "mymessages",
  data() {
    return {
      list:  []
    }
  },
  created() {
    req.list(API_AUTH_PRIVATE_MESSAGE).then(res => {
      console.log(res.rows)
      this.list = res.rows
    })
  }
}
</script>

<style>
.mymessage {
  width: 60vw;
  height: 100vh;
  margin: 0 auto;
}
.list {
  width: 100px;
  height: 100px;
}
.comment {
  width: 615px;
  /* background-color: antiquewhite; */
  margin: 0 auto;
  margin-bottom: 40px;
  margin-top: 1px;
  /* border-top: 3px solid rgb(194, 12, 12); */
}
.commentLogo {
  width: 615px;
  height: 60px;
  border-bottom: 1px solid rgb(217, 217, 217);
  cursor: pointer;
  /* background-color: bisque; */
}
.commentLogo:hover{
  background-color: rgb(188, 186, 186);
  }
.img_logo {
  width: 50px;
  height: 50px;
  cursor: pointer;
  float: left;
}
.cont {
  width: 500px;
  height: 46px;
  /* background-color: aqua; */
  margin-left: 85px;
  line-height: 21px;
  /* float: left; */
}
.sec1 {
  font-size: 12px;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
}
.mm {
  font-size: 14px;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
}
.sec2 {
  /* margin-left: 70px; */
  line-height: 10px;
  font-size: 14px;
}
.text {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-size: 9px;
  margin-top: 15px;
  color: #999;
}
.ul_mess {
  font-size: 25px;
  font-weight: bold;
  margin-bottom: 10px;
  margin-left: 35px;
  border-bottom: 3px solid rgb(194, 12, 12);
}
.blank {
  height: 20px;
}
.time {
  float: right;
  color: #999;
  font-size: 9px;
}
.name{
  font-weight: bold;
}
.top{
  
  margin-top:5px;
}
</style>